package com.dwxt.cdms.applets.dto;

import com.dwxt.cdms.constant.*;

/**
 * @description: TODO
 * @className: IndexReqDTO
 * @author: yanlong
 * @createDate: 2021/05/12 14:20
 * @version: v1.0
 */
public class IndexReqDTO {
    //客户id
    private Integer customerId;
    //查询日期类型 年 月 周 日
    private String dateCategory;
    //数据类型 血糖..
    private String type;
    //开始时间
    private String startTime;
    //结束时间
    private String endTime;
    //设备种类 心电仪..
    private String equipCategory;

    //字段
    private String field;

    private String field1;

    private String field2;

    //表名
    private String table;

    public String getTable() {
        if(EquipCategory.ZNSB.equals(equipCategory)){
            switch (type){
                case ReceiveDataType.STEP:
                    return ZNSBTableName.STEP;
                case ReceiveDataType.BLOOD_PRESSURE:
                    return ZNSBTableName.BLOOD_PRESSURE;
                case ReceiveDataType.SLEEP:
                    return ZNSBTableName.SLEEP;
                case ReceiveDataType.HEARTBEAT:
                    return ZNSBTableName.HEARTBEAT;
            }
        }
        return table;
    }

    public void setTable(String table) {
        this.table = table;
    }

    /**
     * mybatis 查询 组装sql
     * @return
     */
    public String getField() {
        if (EquipCategory.ZNSH.equals(equipCategory)||EquipCategory.ZNSB.equals(equipCategory)) {
            switch (type) {
                case ReceiveDataType.HEARTBEAT:
                    return OuFuDataField.HEARTBEAT;
                case ReceiveDataType.DOUBLE_TEMPERATURE:
                    return OuFuDataField.BODY_TEMPERATURE;
                case ReceiveDataType.STEP:
                    return OuFuDataField.STEP;
                case ReceiveDataType.BLOOD_PRESSURE:
                    return OuFuDataField.SHRINK;
                case ReceiveDataType.BLOOD_SUGAR:
                    return OuFuDataField.BLOOD_SUGAR;

            }
        }/*else if (EquipCategory.ZNSB.equals(equipCategory)) {
            switch (type) {
                case ReceiveDataType.HEARTBEAT:
                    return ZNSBField.HEARTBEAT;
                case ReceiveDataType.STEP:
                    return ZNSBField.STEP;
                case ReceiveDataType.BLOOD_PRESSURE:
                    return ZNSBField.SYSTOLIC;
            }
        }*/
        return field;
    }

    public void setField(String field) {
        this.field = field;
    }

    public String getField1() {
        if (EquipCategory.ZNSH.equals(equipCategory)) {
            switch (type) {
                case ReceiveDataType.DOUBLE_TEMPERATURE:
                    return OuFuDataField.WRIST_TEMPERATURE;
                case ReceiveDataType.BLOOD_PRESSURE:
                    return OuFuDataField.DIASTOLIC;
            }
        }else if(EquipCategory.ZNSB.equals(equipCategory)){
            switch (type) {
                case ReceiveDataType.BLOOD_PRESSURE:
                    return ZNSBField.DIASTOLIC;
            }
        }
        return field1;
    }

    public void setField1(String field1) {
        this.field1 = field1;
    }

    public String getField2() {
        return field2;
    }

    public void setField2(String field2) {
        this.field2 = field2;
    }

    public Integer getCustomerId() {
        return customerId;
    }

    public void setCustomerId(Integer customerId) {
        this.customerId = customerId;
    }

    public String getDateCategory() {
        return dateCategory;
    }

    public void setDateCategory(String dateCategory) {
        this.dateCategory = dateCategory;
    }

    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    public String getStartTime() {
        return startTime;
    }

    public void setStartTime(String startTime) {
        this.startTime = startTime;
    }

    public String getEndTime() {
        return endTime;
    }

    public void setEndTime(String endTime) {
        this.endTime = endTime;
    }

    public String getEquipCategory() {
        return equipCategory;
    }

    public void setEquipCategory(String equipCategory) {
        this.equipCategory = equipCategory;
    }

}
